﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.EquipmentManagement;

namespace Digitalmes.Model.EquipmentManagement
{
    /// <summary>
    /// EquipmentSpotRecord
    /// </summary>
	[Table("EquipmentSpotRecord")]

    [Display(Name = "_Model.EquipmentSpotRecord")]
    public class EquipmentSpotRecord : BasePoco,IPersistPoco,ITenant
    {
        [Display(Name = "_Model._EquipmentSpotRecord._Equipment")]
        [Comment("关联设备")]
        public Equipment Equipment { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._Equipment")]
        [Comment("关联设备")]
        public long? EquipmentId { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._LineId")]
        [Comment("所属产线")]
        public long? LineId { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._LineCode")]
        [Comment("所属产线编号")]
        public string LineCode { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._Content")]
        [Comment("点检内容")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Content { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._OpId")]
        [Comment("所属工位")]
        public long? OpId { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._OpCode")]
        [Comment("所属工位编号")]
        public string OpCode { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._Status")]
        [Comment("点检结果")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public SpotStatusEnum? Status { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._UseOperator")]
        [Comment("操作员")]
        public string UseOperator { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._SpotTable")]
        [Comment("SpotTable")]
        public EquipmentSpotTable SpotTable { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._SpotTable")]
        [Comment("SpotTable")]
        public long? SpotTableId { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._SpotType")]
        [Comment("点检类型")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public SpotTypeEnum? SpotType { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
